package com.mytest.offer;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SolutionJZ55 {

    public static void main(String[] args) {
        SolutionJZ55 solutionJZ6 = new SolutionJZ55();
        ListNode listNode = new ListNode(1);
        ListNode listNode1 = new ListNode(2);
        ListNode listNode2 = new ListNode(3);

        listNode.next = listNode1;
        listNode1.next = listNode2;

//        solutionJZ6.treeDepth(listNode);
    }

    public int treeDepth(TreeNode root) {
        if(root==null){
            return 0;
        }

        return Math.max(treeDepth(root.left), treeDepth(root.right)) + 1;

    }
}

class TreeNode {
    int val = 0;
    TreeNode left = null;
    TreeNode right = null;

    public TreeNode(int val) {
        this.val = val;

    }

}
